
const state = {
  game: 't11', // 当前游戏
}

const mutations = {
  SET_GAME: (state, game) => {
    state.game = game
  }
}

const actions = {
  setGame ({ commit }, game) {
    return new Promise((resolve, reject) => {
      commit('SET_GAME', game)
      resolve()
    })
  },
}
// 触发异步里面的方法是用 this.$store.dispatch('这里是方法名')
// 触发同步里面的方法是用 this.$store.commit('这里是方法名')

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
